/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
 * Description: remote ipc rma buffer implement
 */

#ifndef REMOTE_IPC_RMA_BUFFER_IMPL_H
#define REMOTE_IPC_RMA_BUFFER_IMPL_H

#include "hccl_common.h"
#include "hccl_network_pub.h"
#include "rma_buffer.h"
#include "mem_name_repository_pub.h"

namespace hccl {
class RemoteIpcRmaBufferImpl : public RmaBuffer {
public:
    RemoteIpcRmaBufferImpl(const HcclNetDevCtx netDevCtx);

    HcclResult Deserialize(const std::string&);
    HcclResult Open();
    HcclResult Close();

    ~RemoteIpcRmaBufferImpl();

    RemoteIpcRmaBufferImpl(const RemoteIpcRmaBufferImpl &that) = delete;
    RemoteIpcRmaBufferImpl &operator=(const RemoteIpcRmaBufferImpl &that) = delete;

private:
    const           HcclNetDevCtx netDevCtx{nullptr};
    SecIpcName_t    memName;
    u64             memOffset{0};
};
}
#endif //  REMOTE_IPC_RMA_BUFFER_IMPL_H